package com.zerotwo.exam.web.config;

import com.zerotwo.exam.web.interceptor.UserTokenInterceptor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import javax.annotation.Resource;

/**
 * @author 02
 * @version 1.0
 * @Date 2024/7/5
 * @Description
 */
@Slf4j
public class BaseWebConfig implements WebMvcConfigurer{

    @Resource
    private UserTokenInterceptor tokenInterceptor ;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(tokenInterceptor).addPathPatterns("/**");
    }
}
